﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LevelEditor.model.elements
{
    public class DoublePage
    {
        #region Variables
        private List<AbstractPGameObject> m_pGameObjectsList;
        private int m_pGameObjectsNb;

        #endregion

        #region Constructeurs
        public DoublePage()
        {
            m_pGameObjectsList = new List<AbstractPGameObject>();
            m_pGameObjectsNb = 0;
        }

        #endregion 

        #region Methodes
        public void addPGameObject(AbstractPGameObject pGameObject)
        {
            m_pGameObjectsList.Add(pGameObject);
            m_pGameObjectsNb++;
        }

        public void removePGameObject(int index)
        {
            m_pGameObjectsList.RemoveAt(index);
            m_pGameObjectsNb--;
        }

        public AbstractPGameObject getPGameObject(int index)
        {
            return m_pGameObjectsList[index];
        }

        #endregion

        #region Getters && Setters
        public List<AbstractPGameObject> pGameObjectsList
        {
            get { return m_pGameObjectsList; }
            set
            {
                m_pGameObjectsList = value;
                m_pGameObjectsNb = m_pGameObjectsList.Count();
            }
        }

        public int pGameObjectsNb
        {
            get { return m_pGameObjectsNb;  }
        }

        #endregion
    }
}
